<%-- 
    Document   : saisirNotes
    Created on : 21 avr. 2013, 12:01:58
    Author     : remi
--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Saisie de notes</title>
    </head>
    <body>
        <h1>Saisie de notes</h1>
        <a href="index.jsp">Retourner à l'accueil</a> <br /><br />
        <form method="GET" action="saisirNote">
            <fieldset>
              <legend>Choix de l'examen</legend>
              <br />
              <label>Examen concerné:</label>
              <select name="selectExam" id="selectExam" >
                <c:forEach var="ex" items="${listeE}" >
                    <c:choose>
                        <c:when test="${ex.id_exam==examen.id_exam}">
                            <option selected="selected" value="${ex.id_exam}">${ex.libelleExamen}</option>
                        </c:when>
                        <c:otherwise>
                            <option value="${ex.id_exam}">${ex.libelleExamen}</option>
                        </c:otherwise>
                    </c:choose>
                </c:forEach>
             </select>             
             <br />    
             <input type="submit" value="Valider" />
             </fieldset>
        </form>
        
        <c:if test="${not empty paramValues.selectExam}">
            <form method="post" action="saisirNote">
                
                <fieldset>
                    <legend>Attribution des notes : Promotion <c:out value="${promo.libelle_promo} ${promo.annee_promo}" /></legend><br /> 
                    <table>
                        <tr>
                            <th>Nom</th>
                            <th>Prénom</th>
                            <th>Note</th>                   
                        </tr>
                        <c:forEach var="etudiant" items="${listeU}" >
                            <tr>
                                <td><c:out value="${ etudiant.nom }"/></td>
                                <td><c:out value="${ etudiant.prenom }"/></td>
                                <td><input type="text" name="${ etudiant.id }" value="" size="5" maxlength="5" /></td>
                            </tr>
                        </c:forEach>
                    </table>
                    
                    <input type="hidden"  name="etudiants" value="${listeU}">
                    <input type="hidden"  name="examen" value="${examen.id_exam}">
                    
                    <input type="submit" value="Valider" />
                    
                    <p>${form.resultat}</p>
                </fieldset>
            </form>
        </c:if>
    </body>
</html>
